﻿<Page x:Class="SharpVectors.Converters.FileConverterOutput"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:svg="http://sharpvectors.codeplex.com/runtime/"
    xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="File Converter Output">
    <DockPanel Margin="0 6 0 0">
        <TabControl Name="tabControl" SelectionChanged="OnTabSelectionChanged">
            <TabItem Name="outputTabItem" Header="Output">
                <TextBox Name="txtOutput" IsReadOnly="True" AcceptsReturn="True" 
                         HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"/>
            </TabItem>
            <TabItem Name="viewTabItem" Header="Viewer">
                <DockPanel LastChildFill="True">                    
                    <!-- Wrap the ZoomAndPanControl in a ScrollViewer.
                        When the scaled content that is displayed in ZoomAndPanControl is larger than the viewport onto the content
                        ScrollViewer's scrollbars can be used to manipulate the offset of the viewport. -->
                    <ScrollViewer x:Name="canvasScroller" CanContentScroll="True" Padding="4"
                        VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" AllowDrop="True">

                        <!-- This is the control that handles zooming and panning. -->
                        <svg:ZoomPanControl x:Name="zoomPanControl" Background="LightGray"
                            MouseDown="OnZoomPanMouseDown" MouseUp="OnZoomPanMouseUp"
                            MouseMove="OnZoomPanMouseMove" MouseWheel="OnZoomPanMouseWheel">

                            <!-- This Canvas is the content that is displayed by the ZoomPanControl.
                                Width and Height determine the size of the content. -->
                            <svg:SvgDrawingCanvas x:Name="svgViewer" Background="White"/> 
                        </svg:ZoomPanControl>
                    </ScrollViewer>
                </DockPanel>
            </TabItem>
            <TabItem Name="xamlTabItem" Header="XAML">
                <avalonEdit:TextEditor Name="textEditor" FontFamily="Consolas" FontSize="10pt"/>
            </TabItem>
            <TabItem Name="imageTabItem" Header="Image">
                <Image Name="svgImage"/>
            </TabItem>
        </TabControl>        
    </DockPanel>
</Page>
